#ifndef HTTPLISTENER_H
#define HTTPLISTENER_H

#include <wx/socket.h>

#ifndef HTTP_LISTEN_DATA_BUFFER_SIZE
#define HTTP_LISTEN_DATA_BUFFER_SIZE 1024
#endif

class HttpListener
{
    public:
        HttpListener();
        virtual ~HttpListener();

        bool listen(const wxString& hostName, unsigned short port, long timeoutSec);

    private:
        void Init(const wxString& hostName, unsigned short port);
        void Destroy();
        bool startListening(long timeoutSec);
        bool readInputStream(wxString& resultStr);

        wxIPV4address   m_listenAddress;
        wxSocketServer* m_pServer;
        wxSocketBase*   m_pConnection;
        wxString            m_InputStream;
};

#endif // HTTPLISTENER_H
